import { request } from 'umi';
import { ChannelRequest } from './data';

export async function dyCpsSearch(body: ChannelRequest, options?: { [key: string]: any }) {
  return request('/api/dyCpsSearch', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}
export async function dyCpsSearchStore(body: ChannelRequest, options?: { [key: string]: any }) {
  return request('/api/dyCpsSearchStore', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}

export async function dyCpsWarningCreate(body: ChannelRequest, options?: { [key: string]: any }) {
  return request('/api/dyCpsWarningCreate', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}
export async function dyCpsWarningList(body: ChannelRequest, options?: { [key: string]: any }) {
  return request('/api/dyCpsWarningList', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}

export async function dyCpsGoodCollect(body: ChannelRequest, options?: { [key: string]: any }) {
  return request('/api/dyCpsGoodCollect', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}
export async function dyCpsSearchList(body: ChannelRequest, options?: { [key: string]: any }) {
  return request('/api/dyCpsSearchList', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}

export async function dyCpsCommands(body: ChannelRequest, options?: { [key: string]: any }) {
  return request('/api/dyCpsCommandList', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}
export async function dealCommands(body: any, options?: { [key: string]: any }) {
  return request('/api/dealCommands', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}
export async function savePromoteCommands(body: any, options?: { [key: string]: any }) {
  return request('/api/savePromoteCommands', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}
export async function fetchChannelUser(body: any, options?: { [key: string]: any }) {
  return request('/api/fetchChannelUser', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}
export async function updateProductRate(body: any, options?: { [key: string]: any }) {
  return request('/api/updateProductRate', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}

export async function getShopDayRate(body: any, options?: { [key: string]: any }) {
  return request('/api/getShopDayRate', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}
export async function deleteDyCommand(body: any, options?: { [key: string]: any }) {
  return request('/api/deleteDyCommand', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}
export async function getStoreCate(options?: { [key: string]: any }) {
  return request('/api/getStoreCate', {
    method: 'POST',
    data: { token: localStorage.getItem('token') },
    ...(options || {}),
  });
}

export async function getStoreList(options?: { [key: string]: any }) {
  return request('/api/getStoreList', {
    method: 'POST',
    data: { token: localStorage.getItem('token') },
    ...(options || {}),
  });
}

export async function saveStoreCate(body: any, options?: { [key: string]: any }) {
  return request('/api/saveStoreCate', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}
export async function dyCpsUpdateDayRate(body: any, options?: { [key: string]: any }) {
  return request('/api/dyCpsUpdateDayRate', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}
export async function getStoreDetail(body: any, options?: { [key: string]: any }) {
  return request('/api/getStoreDetail', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}

export async function saveSubChannelPercent(body: any, options?: { [key: string]: any }) {
  return request('/api/saveSubChannelPercent', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}
export async function getSubChannelPercent(body: any, options?: { [key: string]: any }) {
  return request('/api/getSubChannelPercent', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}
export async function dyManualMadList(body: any, options?: { [key: string]: any }) {
  return request('/api/dyManualMadList', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}
export async function dyManualMad(body: any, options?: { [key: string]: any }) {
  return request('/api/dyManualMad', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}

export async function hotProductList(body: any, options?: { [key: string]: any }) {
  return request('/api/hotProductList', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}
export async function queryProduct(body: any, options?: { [key: string]: any }) {
  return request('/api/queryProduct', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}
export async function productsTaskList(body: any, options?: { [key: string]: any }) {
  return request('/api/productsTaskList', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}
export async function saveProductTask(body: any, options?: { [key: string]: any }) {
  return request('/api/saveProductTask', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}
export async function delayCommandTime(body: any, options?: { [key: string]: any }) {
  return request('/api/delayCommandTime', {
    method: 'POST',
    data: { ...body, token: localStorage.getItem('token') },
    ...(options || {}),
  });
}
